package com.cipe.cmrs.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cipe.cmrs.model.Audits;
import com.cipe.cmrs.service.AuditsService;

@Controller
public class AuditsController extends BaseController {

    private static final long serialVersionUID = 1815579886981166259L;

    @Autowired
    private AuditsService auditsService;

    @RequestMapping("/secure/showAuditsList.do")
    public String showAuditsList(Model model) {
        model.addAttribute("auditss", auditsService.findAll());
        return "auditsList";
    }

    @RequestMapping("/secure/findResultAuditsWithProcedure.do")
    public String findResultProjectReportWithProcedure(@ModelAttribute("audits") Audits audits, Model model) {
        model.addAttribute("auditsList", auditsService.findallAudits(audits.getPrc()));
        model.addAttribute("message", audits.getMessage());
        return "findAudits";
    }

}
